<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <mydemo></mydemo>
        
        <parent></parent>
    </div>


    <template id="parent">
        <div>
            <h2>parent ---> 父组件 </h2>

            <hr>

            <childone></childone>
            <childtwo></childtwo>
            
        </div>
    </template>

    <template id="childone">
        <div>
            <h3>childone ---> 子组件 1 </h3>
        </div>
    </template>

    <template id="childtwo">
        <div>
            <h3>childtwo ---> 子组件 2 </h3>
        </div>
    </template>
</body>
<script>
    Vue.component("parent",{
        template:"#parent"
    })

    Vue.component("childone",{
        template:"#childone"
    })

      Vue.component("childtwo",{
        template:"#childtwo"
    })



    Vue.component("mydemo",{
        template:"<h1>good good study , day day up</h1>"
    })
    
    const vm = new Vue({
        data:{
            title:"兄弟组件通信"
        },
        motheds:{

        },
        mounted(){
            document.querySelectorAll("title")[0].innerHTML = this.title
        }
    }).$mount("#app")
</script>
</html>